package com.guit.hrms.mapper;

import com.guit.hrms.po.resume.EmployeeResumeFile;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface EmpResumeMapper {
    /**
     * 根据员工工号获取员工履历
     * @param employeeId 员工工号
     * @return 员工履历
     */
    @Select("select * from employee_resume_file where employee_id = #{employeeId}")
    EmployeeResumeFile findEmpResumeByEmpId(String employeeId);

    /**
     * 更新员工履历
     * @param employeeResumeFile 员工履历信息
     * @return 更新结果
     */
    Integer updateEmpResume(EmployeeResumeFile employeeResumeFile);

    /**
     * 新增员工履历
     * @param employeeResumeFile 员工履历信息
     * @return 新增结果
     */
    @Insert("insert into employee_resume_file(employee_id, file_name, file_content, field_positions, updated_at) values (#{employeeId}, #{fileName}, #{fileContent}, #{fieldPositions}, #{updatedAt})")
    Integer createEmpResume(EmployeeResumeFile employeeResumeFile);

    /**
     * 删除员工履历
     * @param employeeId 员工工号
     * @return 删除结果
     */
    @Delete("delete from employee_resume_file where employee_id = #{employeeId}")
    Integer deleteEmpResume(String employeeId);
}
